<template>
  <div>
    <el-divider content-position="left">服务主页</el-divider>
    <el-button type="text" @click="loginOut">退出登录</el-button>

    <h3>端口号 {{ port }}</h3>
    <el-button
      circle
      type="primary"
      icon="el-icon-refresh"
      @click="init">

    </el-button>
  </div>
</template>

<script>
import {removeToken} from '@/utils/auth'
import {query} from "@/api/common";

export default {
  name: "home",
  mounted() {
    this.init()
  },
  data() {
    return {
      port: ''
    }
  },
  methods: {
    loginOut() {
      removeToken()
      window.location.reload()
    },
    init() {
      query().then((r) => {
        this.port = r
      })
    }
  }
}
</script>
